﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SISGEZATBZVisual.BusinessEntities;

namespace SISGEZATBZVisual.Repository.Mapping
{
    public class AlumnoPagoMap:EntityTypeConfiguration<AlumnoPago>
    {
        public AlumnoPagoMap()
        {
            this.HasKey(c => new { c.IdAlumno,c.IdPago });


            //propiedades


            //table
            this.ToTable("AlumnoPago");

            //Relaciones

            this.HasRequired(c=>c.Alumno)
                .WithMany()
                .HasForeignKey(c=>c.IdAlumno)
                .WillCascadeOnDelete(false);

            this.HasRequired(c=>c.Pago)
                .WithMany()
                .HasForeignKey(c=>c.IdPago)
                .WillCascadeOnDelete(false);
        }
    }
}
